@extends('admin.layout')



@section('content')
    <div class="content-wrapper">
        <!-- Content Header (Page header) -->
        <section class="content-header">
            <h1>
                分类管理
                <small>分类列表</small>
            </h1>
            <ol class="breadcrumb">
                <li><a href="/admin/index"><i class="fa fa-dashboard"></i>首页</a></li>
                <li><a href="#">分类列表</a></li>
            </ol>
        </section>

        <!-- Main content -->
        <section class="content">
            <div class="row">
                <div class="col-xs-12">
                    <div class="box">
                        <div class="box-header">
                        </div><!-- /.box-header -->
                        <div class="box-body">
                        @if((session('info')))
                            <div id = 'jg' class="callout callout-info">
                            <p>{{session('info')}}</p>
                              
                            </div>

                            @endif
                           <!-- select -->
                            <form action="{{url('/admin/user/index')}}" method="get">
                         </div>   
                        </form>

                            <table id="example2" class="table table-bordered table-hover">
                                <thead>
                                <tr>
                                    <th>分类ID</th>
                                    <th>分类名</th>
                                    <th>父类</th>
                                    <th>操作</th>
                                </tr>
                                </thead>
                                <tbody>
                                @foreach($data as $v)
                                <tr>
                                    <td class="ids">{{$v -> id}}</td>
                                    <td class="name">{{$v -> name}}</td>
                                    <td class="name">{{$v -> pname}}</td>

                                    <td><a href="{{
                                    url('/admin/category')}}/{{$v -> id}}/edit"
                                    ><button>编辑</button></a> <form action="{{url('/admin/category/')}}/{{ $v -> id }}" method="post"><button>删除</button>{{ method_field("DELETE")}}{{csrf_field()}}</form></td>                      
                                </tr>
                               @endforeach
                                </tbody>
                             
                            </table>

                        </div>
                </div>
            </div>
        </section>
    </div>
    <script type="text/javascript">

    // 更改用户状态 
        window.onload = function()
        {
            setInterval(function()
            {
                $("#jg").fadeOut(1000);
            },3000);
        }
 
    </script>
@endsection()



